<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var repeatedSubstringPattern = function (s) {
        let temp = s + s
        temp = temp.slice(1, temp.length - 1)
        return temp.indexOf(s) != -1 ? true : false
      }
      repeatedSubstringPattern('abcabc')
      console.log('aaa'.indexOf('a'))
    </script>
  </body>
</html>
